<?php

namespace App\Admin\Controllers;

use App\Facades\AdminC;
use App\Http\Controllers\Controller;
use App\Models\TaskConfigLog;
use App\Models\TotalMemberDay;
use Encore\Admin\Controllers\Dashboard;
use Encore\Admin\Facades\Admin;
use Encore\Admin\Grid;
use Encore\Admin\Layout\Column;
use Encore\Admin\Layout\Content;
use Encore\Admin\Layout\Row;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Input;

class HomeController extends Controller
{
    public function index()
    {
        return Admin::content(function (Content $content) {

            $content->header('首页');
            $content->description('INDEX');

            $content->row(Dashboard::title());
        });
    }

    //用户日收益分类
    public function memberDay()
    {
        $input = Input::all();
        return AdminC::content(function(Content $content){
            $content->header('用户收益');
            $content->description('列表');
            $content->body(AdminC::grid(TotalMemberDay::class, function(Grid $grid){
                $grid->filter(function($filter){
                    $filter->disableIdFilter();
                    $filter->equal('id', '用户id');
                    $filter->date('date', '日期');
                });
                $grid->date('日期');
                $grid->ip('ip/pv');
                $grid->member_id('用户id');
                $grid->column('g_member.name', '用户');
                $grid->new_register('注册奖励');
                $grid->invite('邀请奖励(金币)');
                $grid->invite_1('邀请奖励(现金)');
                $grid->child('下级提成');
                $grid->shared('分享内容奖励');
                $grid->view('浏览内容奖励');
                $grid->test('试玩奖励');
                $grid->checkin('签到奖励');

                $grid->disableExport();
                $grid->disableActions();
                $grid->disableCreateButton();
            }));
        });

    }


}
